package com.ruoyi.util;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.domain.WsResult;

public class WsResultEncoder implements Encoder.Text<WsResult> {

    @Override
    public String encode(WsResult wsResult) throws EncodeException {
        return JSON.toJSONString(wsResult);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
